package owg.util.data;

import com.esotericsoftware.kryo.Kryo;
import com.esotericsoftware.kryo.Serializer;
import com.esotericsoftware.kryo.factories.SerializerFactory;
import com.esotericsoftware.kryo.serializers.CompatibleFieldSerializer;

public class KryoInstance {
	public static Kryo kryo;

	public static void init()
	{

	}

	static
	{
		kryo = new Kryo();
		kryo.setClassLoader(ClassLoader.getSystemClassLoader());
		kryo.setDefaultSerializer(new SerializerFactory() {
			@Override
			public Serializer<?> makeSerializer(Kryo kryo, Class<?> type) {
				@SuppressWarnings("rawtypes")
				CompatibleFieldSerializer<?> s = new CompatibleFieldSerializer(kryo, type);
				s.setCopyTransient(false);
				return s;
			}
		});
	}
	/**Indicates that this constructor is for use by Kryo only.*/
	public static @interface K {}
}
